(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) → sum(app(l, sum(cons(x, cons(y, k)))))
plus(0, y) → y
plus(s(x), y) → s(plus(x, y))
sum(plus(cons(0, x), cons(y, l))) → pred(sum(cons(s(x), cons(y, l))))
pred(cons(s(x), nil)) → cons(x, nil)
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
app(cons(x, l), k) →+ cons(x, app(l, k))
gives rise to a decreasing loop by considering the right hand sides subterm at position [1].
The pumping substitution is [l / cons(x, l)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) → sum(app(l, sum(cons(x, cons(y, k)))))
plus(0', y) → y
plus(s(x), y) → s(plus(x, y))
sum(plus(cons(0', x), cons(y, l))) → pred(sum(cons(s(x), cons(y, l))))
pred(cons(s(x), nil)) → cons(x, nil)
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
app(nil, k) → k
app(l, nil) → l
app(cons(x, l), k) → cons(x, app(l, k))
sum(cons(x, nil)) → cons(x, nil)
sum(cons(x, cons(y, l))) → sum(cons(plus(x, y), l))
sum(app(l, cons(x, cons(y, k)))) → sum(app(l, sum(cons(x, cons(y, k)))))
plus(0', y) → y
plus(s(x), y) → s(plus(x, y))
sum(plus(cons(0', x), cons(y, l))) → pred(sum(cons(s(x), cons(y, l))))
pred(cons(s(x), nil)) → cons(x, nil)
Types:
app :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
nil :: nil:cons:0':s
cons :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
sum :: nil:cons:0':s → nil:cons:0':s
plus :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
0' :: nil:cons:0':s
s :: nil:cons:0':s → nil:cons:0':s
pred :: nil:cons:0':s → nil:cons:0':s
hole_nil:cons:0':s1_0 :: nil:cons:0':s
gen_nil:cons:0':s2_0 :: Nat → nil:cons:0':s
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
app,
sum,
plusThey will be analysed ascendingly in the following order:
app < sum
plus < sum
(8) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
sum(
plus(
cons(
0',
x),
cons(
y,
l))) →
pred(
sum(
cons(
s(
x),
cons(
y,
l))))
pred(
cons(
s(
x),
nil)) →
cons(
x,
nil)
Types:
app :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
nil :: nil:cons:0':s
cons :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
sum :: nil:cons:0':s → nil:cons:0':s
plus :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
0' :: nil:cons:0':s
s :: nil:cons:0':s → nil:cons:0':s
pred :: nil:cons:0':s → nil:cons:0':s
hole_nil:cons:0':s1_0 :: nil:cons:0':s
gen_nil:cons:0':s2_0 :: Nat → nil:cons:0':s
Generator Equations:
gen_nil:cons:0':s2_0(0) ⇔ nil
gen_nil:cons:0':s2_0(+(x, 1)) ⇔ cons(nil, gen_nil:cons:0':s2_0(x))
The following defined symbols remain to be analysed:
app, sum, plus
They will be analysed ascendingly in the following order:
app < sum
plus < sum
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
app(
gen_nil:cons:0':s2_0(
n4_0),
gen_nil:cons:0':s2_0(
b)) →
gen_nil:cons:0':s2_0(
+(
n4_0,
b)), rt ∈ Ω(1 + n4
0)
Induction Base:
app(gen_nil:cons:0':s2_0(0), gen_nil:cons:0':s2_0(b)) →RΩ(1)
gen_nil:cons:0':s2_0(b)
Induction Step:
app(gen_nil:cons:0':s2_0(+(n4_0, 1)), gen_nil:cons:0':s2_0(b)) →RΩ(1)
cons(nil, app(gen_nil:cons:0':s2_0(n4_0), gen_nil:cons:0':s2_0(b))) →IH
cons(nil, gen_nil:cons:0':s2_0(+(b, c5_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
sum(
plus(
cons(
0',
x),
cons(
y,
l))) →
pred(
sum(
cons(
s(
x),
cons(
y,
l))))
pred(
cons(
s(
x),
nil)) →
cons(
x,
nil)
Types:
app :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
nil :: nil:cons:0':s
cons :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
sum :: nil:cons:0':s → nil:cons:0':s
plus :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
0' :: nil:cons:0':s
s :: nil:cons:0':s → nil:cons:0':s
pred :: nil:cons:0':s → nil:cons:0':s
hole_nil:cons:0':s1_0 :: nil:cons:0':s
gen_nil:cons:0':s2_0 :: Nat → nil:cons:0':s
Lemmas:
app(gen_nil:cons:0':s2_0(n4_0), gen_nil:cons:0':s2_0(b)) → gen_nil:cons:0':s2_0(+(n4_0, b)), rt ∈ Ω(1 + n40)
Generator Equations:
gen_nil:cons:0':s2_0(0) ⇔ nil
gen_nil:cons:0':s2_0(+(x, 1)) ⇔ cons(nil, gen_nil:cons:0':s2_0(x))
The following defined symbols remain to be analysed:
plus, sum
They will be analysed ascendingly in the following order:
plus < sum
(12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol plus.
(13) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
sum(
plus(
cons(
0',
x),
cons(
y,
l))) →
pred(
sum(
cons(
s(
x),
cons(
y,
l))))
pred(
cons(
s(
x),
nil)) →
cons(
x,
nil)
Types:
app :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
nil :: nil:cons:0':s
cons :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
sum :: nil:cons:0':s → nil:cons:0':s
plus :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
0' :: nil:cons:0':s
s :: nil:cons:0':s → nil:cons:0':s
pred :: nil:cons:0':s → nil:cons:0':s
hole_nil:cons:0':s1_0 :: nil:cons:0':s
gen_nil:cons:0':s2_0 :: Nat → nil:cons:0':s
Lemmas:
app(gen_nil:cons:0':s2_0(n4_0), gen_nil:cons:0':s2_0(b)) → gen_nil:cons:0':s2_0(+(n4_0, b)), rt ∈ Ω(1 + n40)
Generator Equations:
gen_nil:cons:0':s2_0(0) ⇔ nil
gen_nil:cons:0':s2_0(+(x, 1)) ⇔ cons(nil, gen_nil:cons:0':s2_0(x))
The following defined symbols remain to be analysed:
sum
(14) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol sum.
(15) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
sum(
plus(
cons(
0',
x),
cons(
y,
l))) →
pred(
sum(
cons(
s(
x),
cons(
y,
l))))
pred(
cons(
s(
x),
nil)) →
cons(
x,
nil)
Types:
app :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
nil :: nil:cons:0':s
cons :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
sum :: nil:cons:0':s → nil:cons:0':s
plus :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
0' :: nil:cons:0':s
s :: nil:cons:0':s → nil:cons:0':s
pred :: nil:cons:0':s → nil:cons:0':s
hole_nil:cons:0':s1_0 :: nil:cons:0':s
gen_nil:cons:0':s2_0 :: Nat → nil:cons:0':s
Lemmas:
app(gen_nil:cons:0':s2_0(n4_0), gen_nil:cons:0':s2_0(b)) → gen_nil:cons:0':s2_0(+(n4_0, b)), rt ∈ Ω(1 + n40)
Generator Equations:
gen_nil:cons:0':s2_0(0) ⇔ nil
gen_nil:cons:0':s2_0(+(x, 1)) ⇔ cons(nil, gen_nil:cons:0':s2_0(x))
No more defined symbols left to analyse.
(16) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
app(gen_nil:cons:0':s2_0(n4_0), gen_nil:cons:0':s2_0(b)) → gen_nil:cons:0':s2_0(+(n4_0, b)), rt ∈ Ω(1 + n40)
(17) BOUNDS(n^1, INF)
(18) Obligation:
TRS:
Rules:
app(
nil,
k) →
kapp(
l,
nil) →
lapp(
cons(
x,
l),
k) →
cons(
x,
app(
l,
k))
sum(
cons(
x,
nil)) →
cons(
x,
nil)
sum(
cons(
x,
cons(
y,
l))) →
sum(
cons(
plus(
x,
y),
l))
sum(
app(
l,
cons(
x,
cons(
y,
k)))) →
sum(
app(
l,
sum(
cons(
x,
cons(
y,
k)))))
plus(
0',
y) →
yplus(
s(
x),
y) →
s(
plus(
x,
y))
sum(
plus(
cons(
0',
x),
cons(
y,
l))) →
pred(
sum(
cons(
s(
x),
cons(
y,
l))))
pred(
cons(
s(
x),
nil)) →
cons(
x,
nil)
Types:
app :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
nil :: nil:cons:0':s
cons :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
sum :: nil:cons:0':s → nil:cons:0':s
plus :: nil:cons:0':s → nil:cons:0':s → nil:cons:0':s
0' :: nil:cons:0':s
s :: nil:cons:0':s → nil:cons:0':s
pred :: nil:cons:0':s → nil:cons:0':s
hole_nil:cons:0':s1_0 :: nil:cons:0':s
gen_nil:cons:0':s2_0 :: Nat → nil:cons:0':s
Lemmas:
app(gen_nil:cons:0':s2_0(n4_0), gen_nil:cons:0':s2_0(b)) → gen_nil:cons:0':s2_0(+(n4_0, b)), rt ∈ Ω(1 + n40)
Generator Equations:
gen_nil:cons:0':s2_0(0) ⇔ nil
gen_nil:cons:0':s2_0(+(x, 1)) ⇔ cons(nil, gen_nil:cons:0':s2_0(x))
No more defined symbols left to analyse.
(19) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
app(gen_nil:cons:0':s2_0(n4_0), gen_nil:cons:0':s2_0(b)) → gen_nil:cons:0':s2_0(+(n4_0, b)), rt ∈ Ω(1 + n40)
(20) BOUNDS(n^1, INF)